home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 11 Exotic Applications / SC072.ZIP / SC_ARC.ZIP / ZIPCODE.DOC < prev   
Encoding:
Text File  |  1996-05-20  |  2.6 KB  |  63 lines

  1.  
  2.                               The ZipCode format
  3.  
  4.   WARNING: The description below is a mere extrapolation  from  the  files  and
  5. program sources I've encountered.
  6.  
  7.   The ZipCode algorithm is used to split and  compress  disk  images  and  1541
  8. disks so that the chunks may fit onto a single 1541 disk. This way even  people
  9. connecting to the Net with Commodore machines can also download,  then  extract
  10. and use such disks.
  11.   The algorithm creates four separate files out of one disk. On the PC the base
  12. name of the ZipCode archives comes from the name of the  original  disk  image.
  13. The four files are numbered this way: '1!BASE.EXT', ..., '4!BASE.EXT'.
  14.   These files contain the following data:
  15.  
  16.   FILE          POSITION        DESCRIPTION
  17.   1!BASE.EXT    $0000-$0001     Load address (usually $03FE)
  18.                 $0002-$0003     ID of the original disk (not the one in the BAM
  19.                                 but the one in block headers); in files created
  20.                                 on the PC its default is the string '64'
  21.                 $0004-          data of tracks 1-8
  22.  
  23.   2!BASE.EXT    $0000-$0001     Load address (usually $0400)
  24.                 $0002-          data of tracks 9-16
  25.  
  26.   3!BASE.EXT    $0000-$0001     Load address (usually $0400)
  27.                 $0002-          data of tracks 17-25
  28.  
  29.   4!BASE.EXT    $0000-$0001     Load address (usually $0400)
  30.                 $0002-          data of tracks 26-35
  31.  
  32.   Blocks in track data are  usually  recorded  with  a  10  block  soft  sector
  33. interleave and not sequentially. This  way  is  much  faster  to  compress  and
  34. decompress on a Commodore machine. A block looks like this:
  35.  
  36.   POSITION      DESCRIPTION
  37.   $0000         BITS 6-7: Compression mode:
  38.                   00    block data is stored unchanged (byte by byte)
  39.                   01    block is homogeneous (filled by a single byte)
  40.                   10    block data is RLE-compressed
  41.                   11    unused
  42.                 BITS 0-5: Track number
  43.   $0001         Sector number
  44.   $0002-        Block data
  45.  
  46.   Unchanged block data:
  47.  
  48.   $0002-$0101   Data of the original block (256 bytes)
  49.  
  50.   Homogeneous block data:
  51.  
  52.   $0002         Fill byte (1 byte)
  53.  
  54.   RLE-compressed block data:
  55.  
  56.   $0002         Length of compressed data
  57.   $0003         Mark byte
  58.   $0004-LEN+3   RLE-compressed data (LEN bytes)
  59.                 a 'mark byte - repeat count - data byte'  byte  sequence  tells
  60.                 that there was a 'repeat count' long sequence  of  'data bytes'
  61.                 in the original block; sequences shorter than  four  bytes  are
  62.                 not compressed
  63.